package guitk;

import gr.takeda.rhythmguitar.models.ChordListModel;

import java.awt.Font;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListSelectionModel;

public class CustomList extends JList {

	private static final long serialVersionUID = -8638115061943507339L;

	public CustomList(Object[] values) {
		super(values);
		setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		DefaultListCellRenderer renderer = (DefaultListCellRenderer) getCellRenderer();
		setFont(new Font("Monospace", Font.BOLD, 18));
		renderer.setHorizontalAlignment(JLabel.CENTER);
		setSelectedIndex(0);
	}

	public CustomList(ChordListModel chords) {
		super(chords);
		setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		DefaultListCellRenderer renderer = (DefaultListCellRenderer) getCellRenderer();
		setFont(new Font("Monospace", Font.BOLD, 18));
		renderer.setHorizontalAlignment(JLabel.CENTER);
	}

}
